package org.example.order.listener;

import com.rabbitmq.client.Channel;
import org.example.order.cache.OrderCacheList;
import org.example.order.domain.Order;
import org.springframework.amqp.core.Message;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

import java.io.IOException;

/**
 * Description: 订单消息监听器
 * Author: e
 * CreateDate: 2021-08-02
 */
@Component
public class OrderMessageListener {


    //@RabbitListener(queues = "q.order", ackMode = "MANUAL")
    //public void handleMessageTopic(
    //        Channel channel,
    //        Long orderId,
    //        Message message) throws IOException {
    //    OrderCacheList.updateOrderStatus(orderId,1,"");
    //    System.out.println("消息消费: "+OrderCacheList.ORDER_MAP.get(orderId).toString());
    //    //消息确认
    //    channel.basicAck(message.getMessageProperties().getDeliveryTag(), false);
    //}

}
